/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.service;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.chlitina.store.common.persistence.Page;
import com.chlitina.store.common.service.BaseService;
import com.chlitina.store.modules.expert.dao.SolutionFaceStoreTypeDao;
import com.chlitina.store.modules.expert.entity.SolutionFaceStoreType;

/**
 * 肤质方案店面类型Service
 * @author liujiang
 * @version 2014-03-10
 */
@Component
@Transactional(readOnly = true)
public class SolutionFaceStoreTypeService extends BaseService {

	@SuppressWarnings("unused")
	private static Logger logger = LoggerFactory.getLogger(SolutionFaceStoreTypeService.class);
	
	@Autowired
	private SolutionFaceStoreTypeDao solutionFaceStoreTypeDao;
	
	public SolutionFaceStoreType get(Long id) {
		return solutionFaceStoreTypeDao.findOne(id);
	}
	
	public Page<SolutionFaceStoreType> find(Page<SolutionFaceStoreType> page, SolutionFaceStoreType solutionFaceStoreType) {
		DetachedCriteria dc = solutionFaceStoreTypeDao.createDetachedCriteria();
		dc.addOrder(Order.desc("id"));
		return solutionFaceStoreTypeDao.find(page, dc);
	}
	
	@Transactional(readOnly = false)
	public void save(SolutionFaceStoreType solutionFaceStoreType) {
		solutionFaceStoreTypeDao.save(solutionFaceStoreType);
	}
	
	@Transactional(readOnly = false)
	public void delete(Long sid, Long tid) {
		solutionFaceStoreTypeDao.delete(sid, tid);
	}
}
